.class public Sample_google_two_deep_with_set_addition
.super scarlett/ScarlettRuntime
; standard initializer
.method public <init>()V
   aload_0
   invokenonvirtual scarlett/ScarlettRuntime/<init>()V
   return
 .end method
.method public static main([Ljava/lang/String;)V
    .limit stack 16
    .limit locals 2
    new Sample_google_two_deep_with_set_addition
    dup
    invokenonvirtual Sample_google_two_deep_with_set_addition/<init>()V
    aload_0
    invokenonvirtual Sample_google_two_deep_with_set_addition/ScarlettMain([Ljava/lang/String;)V
	return
.end method

.method public  run([Ljava/lang/String;)V
.var 2 is eachURI Ljava/lang/String;
.var 4 is emailLinks Ljava/util/List;
.var 3 is emailLinksTemp Ljava/util/List;
.var 1 is resultURIs Ljava/util/List;
    aconst_null
    astore 2
    aconst_null
    astore 4
    aconst_null
    astore 3
    aconst_null
    astore 1

	aload_0 ; This ptr for Show command
	ldc "Search Google for Professor Mak Links" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "Then Print them all Out" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; this pointer for Fetch
	; begin source
	ldc "http://www.google.com/search?q=Mak+sjsu" ; httpuri
	; end source
	; begin regex
	aload_0 ; this pointer for regex call
	ldc "uri"
	invokevirtual scarlett/ScarlettRuntime/GetPattern(Ljava/lang/String;)Ljava.util.regex.Pattern;
	; end regex
	invokevirtual scarlett/ScarlettRuntime/Fetch(Ljava/lang/String;Ljava.util.regex.Pattern;)Ljava.util.List;
	astore 1
	aload 1 ;load variable resultURIs
	astore 1 ; store the source on TOS into the var
	aload 1 ; store the source on TOS into the var
	; get the iterator 
	invokeinterface java.util.List/iterator()Ljava/util/Iterator; 1
	L000:
	dup
	dup
	; get the next value 
	invokeinterface java.util.Iterator/next()Ljava/lang/Object; 1
	checkcast java/lang/String
	astore 2
	; Loop statements
	aload_0 ; This ptr for Show command
	aload 2 ;load variable eachURI
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; this pointer for Fetch
	; begin source
	aload 2 ;load variable eachURI
	; end source
	; begin regex
	aload_0 ; this pointer for regex call
	ldc "email"
	invokevirtual scarlett/ScarlettRuntime/GetPattern(Ljava/lang/String;)Ljava.util.regex.Pattern;
	; end regex
	invokevirtual scarlett/ScarlettRuntime/Fetch(Ljava/lang/String;Ljava.util.regex.Pattern;)Ljava.util.List;
	astore 3
	
	; Begin check for variable emailLinks
	aload 4 ;load variable emailLinks
	ifnonnull L002
	new java/util/ArrayList
	dup
	invokespecial java/util/ArrayList.<init>()V
	astore 4
	
L002:
	aload_0
	aload 3 ;load variable emailLinksTemp
	aload 4 ;load variable emailLinks
	invokevirtual scarlett/ScarlettRuntime/Insert(Ljava/lang/Object;Ljava/lang/Object;)V
	;End Loop statements
	invokeinterface java.util.Iterator/hasNext()Z 1
	ifne L000 ; bottom of loop
	aload_0 ; This ptr for Show command
	ldc "" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	ldc "" ; stringConstant
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
	aload_0 ; This ptr for Show command
	aload 4 ;load variable emailLinks
	invokevirtual scarlett/ScarlettRuntime/Show(Ljava/lang/Object;)V
    return

.limit locals 9
.limit stack  16
.end method
